package org.desktop.intbox.components.treemap.layouts;

import prefuse.action.layout.graph.RadialTreeLayout;
import prefuse.visual.NodeItem;

public class ScalingTreeLayout extends RadialTreeLayout {

	private double newX = -1;
	private double newY = -1;

	public ScalingTreeLayout(String group) {
		super(group);
	}

	protected void setPolarLocation(NodeItem n, NodeItem p, double r, double t) {
		if (newX >= 0 && newY >= 0) {
			setX(n, p, m_origin.getX() + newX);
			setY(n, p, m_origin.getY() + newY);
		} else {
			setPolarLocation(n, p, r, t);
		}
	}

	public void setNewSize(double newX, double newY) {
		this.newX = newX;
		this.newY = newY;
	}

}
